<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ include file="/commons/pages/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div class="subtitle">
  <h3>编辑信息</h3>
</div>
<s:form action="BaseRoomInfo!save.action" method="post" name="form">
  <s:token />
  <input type="hidden" name="model.id" value="<s:property value='model.id'/>"/>
  <table width="100%" border="0" cellpadding="5" cellspacing="1" class="tbl_list">
    <tr>
      <th width="20%" align="right"><font color="red">*</font>门牌号：</th>
      <td width="80%"><input name="model.house_num" type="text" class="webinput" size="25" dataType="Require" msg="请填写"  value="<s:property value='model.house_num'/>"/></td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>所属项目：</th>
      <td width="80%">
   	  <select id="sel_proj" name="model.proj_id" dataType="Require" msg="请填写选择" onchange="initShareList(this.value,'sel_area')"></select>
      </td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>所属分摊区域：</th>
      <td width="80%">
   	  <select id="sel_area" name="model.area_id" dataType="Require" msg="请填写选择"  onchange="initBuildingList(this.value,'sel_build')"></select>
      </td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>所属楼栋：</th>
      <td width="80%">
   	  <select id="sel_build" name="model.build_id" dataType="Require" msg="请选择" onchange="initUnit(this.value)">
      	</select>
      </td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>单元：</th>
      <td width="80%">
   	  <select id="unit_select" name="model.unit_no" dataType="Require" msg="请填写选择">
      	</select>单元</td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>楼层：</th>
      <td width="80%"><input name="model.floor_no" type="text" class="webinput" size="25" dataType="Require" msg="请填写"  value="<s:property value='model.floor_no'/>"/>层
      	</td>
    </tr>
    <tr>
      <th width="20%" align="right">楼层位置：</th>
      <td width="80%">
   	  <select name="model.floor_pos">
      		<option value="">请选择</option>
      		<option value="1" <s:if test="model.floor_pos==1">selected="selected"</s:if>>顶楼</option>
      		<option value="2" <s:if test="model.floor_pos==2">selected="selected"</s:if>>中间层</option>
      		<option value="3" <s:if test="model.floor_pos==3">selected="selected"</s:if>>底层</option>
		</select>
		</td>
    </tr>
    <tr>
      <th width="20%" align="right">是否为边户：</th>
      <td width="80%">
   	  <select name="model.is_side">
      		<option value="">请选择</option>
      		<option value="0" <s:if test="model.is_side==0">selected="selected"</s:if>>是边户</option>
      		<option value="1" <s:if test="model.is_side==1">selected="selected"</s:if>>不是边户</option>
		</select>
		</td>
    </tr>
    <tr>
      <th width="20%" align="right">户主姓名：</th>
      <td width="80%"><input name="model.name" type="text" class="webinput" size="25" value="<s:property value='model.name'/>"/></td>
    </tr>
    <tr>
      <th width="20%" align="right">联系电话：</th>
      <td width="80%"><input name="model.tel" type="text" class="webinput" size="25" value="<s:property value='model.tel'/>"/></td>
    </tr>
    <tr>
      <th width="20%" align="right">电子邮件：</th>
      <td width="80%"><input name="model.email" type="text" class="webinput" size="25" value="<s:property value='model.email'/>"/></td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>建筑面积：</th>
      <td width="80%"><input name="model.struct_area" type="text" dataType="Ftdfnum" msg="请用数字正确填写" class="webinput" size="25" value="<s:property value='model.struct_area'/>"/>㎡</td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>供热面积：</th>
      <td width="80%"><input name="model.hear_area" type="text" dataType="Ftdfnum" msg="请用数字正确填写" class="webinput" size="25" value="<s:property value='model.hear_area'/>"/>㎡</td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>是否参与计量收费：</th>
      <td width="80%">
   	  <select name="model.is_cal" dataType="Require" msg="请选择">
      		<option value="">请选择</option>
      		<option value="0" <s:if test="model.is_cal==0">selected="selected"</s:if>>参与</option>
      		<option value="1" <s:if test="model.is_cal==1">selected="selected"</s:if>>不参与</option>
		</select>
      </td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>户修正系数：</th>
      <td width="80%"><input name="model.xz_factor" type="text" class="webinput" size="25" value="<s:property value='model.xz_factor'/>" dataType="Ftdfnum" msg="请用数字正确填写"/></td>
    </tr>
    <tr>
      <th width="20%" align="right">账单自动发送：</th>
      <td width="80%">
   	  <select name="model.send_bill">
      		<option value="">请选择</option>
      		<option value="0" <s:if test="model.send_bill==0">selected="selected"</s:if>>发送</option>
      		<option value="1" <s:if test="model.send_bill==1">selected="selected"</s:if>>不发送</option>
		</select>
      </td>
    </tr>
    <tr>
      <th width="20%" align="right">备注：</th>
      <td width="80%"><textarea id="textarea" name="model.demo" cols="60" rows="8"><s:property value='model.demo'/></textarea></td>
    </tr>
    <tr>
      <th>&nbsp;</th>
      <td><input type="submit" class="websub" value="提 交" />
        <input type="button" class="websub" onclick="history.back();" value="返 回" /></td>
    </tr>
  </table>
</s:form>
<script src='/dwr/interface/BaseDataService.js'></script>
<script src='/dwr/engine.js'></script>
<script src='/dwr/util.js'></script>
<script src='/commons/scripts/validator.js'></script> 
<script type="text/javascript">
$j(document).ready(function(){
	initProjAreaBuildingRoom('sel_proj','<s:property value='model.proj_id'/>','sel_area','<s:property value='model.area_id'/>','sel_build','<s:property value='model.build_id'/>');
	initUnit('<s:property value="model.build_id"/>','<s:property value="model.unit_no"/>');
	form.onsubmit = function () {
		return Validator.Validate(this, 3);
	}
});

function initUnit(buildId,unitValue){
	DWRUtil.removeAllOptions('unit_select');
	BaseDataService.getUnitList(buildId,function(BaseData){
		DWRUtil.addOptions('unit_select', {'':'请选择'});
    	DWRUtil.addOptions('unit_select', BaseData, "id", "unit_name");
    	if(unitValue){
    		DWRUtil.setValue('unit_select', unitValue);
    	}
	});
}
</script>
</body>
</html>
